import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '商品ID',
    align: 'center',
    dataIndex: 'productId',
  },
  {
    title: '商品名称',
    align: 'center',
    dataIndex: 'productName',
  },
  {
    title: '商品规格或型号',
    align: 'center',
    dataIndex: 'specification',
    customRender: ({ text }) => {
      return render.renderDict(text, 'product_code');
    },
  },
  {
    title: '当前库存数量',
    align: 'center',
    dataIndex: 'currentStock',
  },
  {
    title: '库存预警阈值',
    align: 'center',
    dataIndex: 'warningThreshold',
  },
  {
    title: '商品单价',
    align: 'center',
    dataIndex: 'unitPrice',
  },
  {
    title: '库存总价值(自动计算)',
    align: 'center',
    dataIndex: 'stockValue',
  },
  {
    title: '商品存放仓库位置',
    align: 'center',
    dataIndex: 'warehouseLocation',
  },
  {
    title: '最后入库时间',
    align: 'center',
    dataIndex: 'lastStockInTime',
  },
  {
    title: '最后出库时间',
    align: 'center',
    dataIndex: 'lastStockOutTime',
  },
  {
    title: '租户ID',
    align: 'center',
    dataIndex: 'tenantId',
  },
];

// 高级查询数据
export const superQuerySchema = {
  productId: { title: '商品ID', order: 0, view: 'text', type: 'string' },
  productName: { title: '商品名称', order: 1, view: 'text', type: 'string' },
  specification: { title: '商品规格或型号', order: 2, view: 'list', type: 'string', dictCode: '' },
  currentStock: { title: '当前库存数量', order: 3, view: 'number', type: 'number' },
  warningThreshold: { title: '库存预警阈值', order: 4, view: 'number', type: 'number' },
  unitPrice: { title: '商品单价', order: 5, view: 'number', type: 'number' },
  stockValue: { title: '库存总价值(自动计算)', order: 6, view: 'number', type: 'number' },
  warehouseLocation: { title: '商品存放仓库位置', order: 7, view: 'text', type: 'string' },
  lastStockInTime: { title: '最后入库时间', order: 8, view: 'datetime', type: 'string' },
  lastStockOutTime: { title: '最后出库时间', order: 9, view: 'datetime', type: 'string' },
  tenantId: { title: '租户ID', order: 10, view: 'number', type: 'number' },
};
